import { ICondition } from '../../interfaces';

/**
 * 向params condition中增加排序参数
 */
export default function add_sort(condition: ICondition, field_name: string, asc: number) {
	const sort = condition.sort || (condition.sort = {} as any);
	asc = asc ? 1 : -1;
	sort[field_name] = asc;
	return condition;
}
